package com.antipov.odp.pojo;

/**
 * Created with IntelliJ IDEA.
 * User: Andrew Antipov
 * Date: 18.02.14
 * Time: 21:49
 */
public class C extends A implements I {

	public static final int ID = 3;

	protected char c;

	public C(int[] array, int x, char c) {
		super(array, x);
		this.c = c;
	}

	@Override
	public int foo() {
		return super.foo() * c;
	}

	public char getC() {
		return c;
	}

	public void setC(char c) {
		this.c = c;
	}

	@Override
	public String toString() {
		String res = "";
		res += ID;
		res += ' ';
		res += internalStateToString();
		res += ' ';
		res += c;
		return res;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || !(o instanceof C)) return false;
		if (!super.equals(o)) return false;

		C c1 = (C) o;

		return c == c1.c;
	}

	@Override
	public int hashCode() {
		int result = super.hashCode();
		result = 31 * result + (int) c;
		return result;
	}
}
